package com.example.jasyptdb.controller;

import com.example.jasyptdb.service.PriceListService;
import com.example.jasyptdb.util.HttpResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *  TODO
 * @author 江
 * @date 2021/9/13 下午 14:55
 */
@RestController
public class PriceListController {

    private static final Logger logger = LoggerFactory.getLogger(PriceListController.class);

    @Autowired
    PriceListService priceListService;

    /**
     *  项目启动时候先运行
     * @date 2021/9/13 下午 14:52
     */
    @PostConstruct
    public void initialization() {
        logger.info("=============initialization:开始initialization...==============");
        logger.info("\r\n");
        logger.info("\r\n");
        logger.info("\r\n");
        logger.info("\r\n");
        logger.info("=============initialization:结束 initialization...==============");
    }

    /**********************************价格表页面接口*********************************/


    /**
     *  价格表页面查询
     * @date 2021/9/13 下午 14:53
     */
    @GetMapping("/Select_all_price_list")
    public HttpResult selectAllPriceList(@RequestParam("page") int page,
                                         @RequestParam("pageSize") int pageSize, HttpServletRequest request, HttpServletResponse response) {

        return priceListService.selectAllPriceList(page,pageSize);
    }






}
